package kgame5.k3d.pars.myflint.geom {

/**
	 * @author user
	 */
	public class Vector3DUtilsFlint 
	{
		public static function getPerpendiculars( normal:Vector3DFlint ):Array
		{
			var p1:Vector3DFlint = getPerpendicular( normal );
			var p2:Vector3DFlint = normal.crossProduct( p1 ).normalize();
			return [ p1, p2 ];
		}
		
		public static function getPerpendicular( v:Vector3DFlint ):Vector3DFlint
		{
			if( v.x == 0 )
			{
				return new Vector3DFlint( 1, 0, 0 );
			}
			else
			{
				return new Vector3DFlint( v.y, -v.x, 0 ).normalize();
			}
		}
	}
}
